<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>初始函数</title>

	<script>
       function SetStyle(btn,box){
          btn.onclick=function(){
            btn.style.color="#ff0000";
            btn.style.background="#fff";
            btn.style.border="1px solid #000";
            btn.style.padding="20px";
            btn.style.margin="20px";
            box.style.background="red";
            box.style.width="100px";
            box.style.height="100px";
         }
       }

       window.onload=function(){
       	    var btn=document.getElementById('btn');
       	    var btn1=document.getElementById('btn1');
       	    var box=document.getElementById('box');
            SetStyle(btn,box);
            SetStyle(btn1,box);
       }

	</script>
</head>
<body>
    <button id="btn">呵呵</button>
    <button id="btn1">哈哈</button>
    <div id="box"></div>
</body>
</html>